import request from '@/utils/request'

const API = {
    USER_LOGIN: '/auth/user/doLogin?validCode=', // 用户登录
    USER_LOGOUT: '/auth/user/logOut?userName=', // 用户登出
    USER_INFO: '/auth/user/info', // 用户信息
    USER_UPDATE: '/auth/user/update', // 用户信息更新
    USER_ROLE: '', // 用户角色
    USER_PERMISSION: '/auth/permission/getPermission?userName=', // 用户权限
    
}

export const reqLogin = (validCode) => request.post(API.USER_LOGIN + validCode)

export const reqLogOut = (userName) => request.post(API.USER_LOGOUT + userName)

export const reqUserInfo = () => request.post(API.USER_INFO)

export const reqUserUpdate = (data) => request.put(API.USER_UPDATE, data)

export const reqUserRole = (userName) => request.post(API.USER_ROLE + userName)

export const reqUserPermission = (userName) => request.post(API.USER_PERMISSION + userName)